#!/bin/bash

PROJECT_DIR=$(cd `dirname $0`; pwd)
BUILD_DIR=${PROJECT_DIR}/build

OS_NAME=$(uname -s)

# 判断系统类型
if [ "$OS_NAME" = "Darwin" ]; then
    echo "This is macOS"
    export DYLD_LIBRARY_PATH="$PROJECT_DIR/third_party/mysql_cpp_connx/lib/aarch64/MacOS"
elif [ "$OS_NAME" = "Linux" ]; then
    echo "This is Linux"
else
    echo "Unknown OS: $OS_NAME"
fi

cd ${BUILD_DIR}

if [ "$1" = "debug" ]; then
    lldb ./network_framework_server.out
else
    ./network_framework_server.out
fi
